package 集合.Collection.Collection中的常用方法.List接口特有方法.Test01;


import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

public class ListTest01 {
    public static void main(String[] args) {
        List myList = new LinkedList();
        myList.add("A");
        myList.add("b");
        myList.add("C");
        myList.add("V");
        myList.add("V");
        myList.add(1,"Killer queen");
        Iterator it = myList.iterator();
        while(it.hasNext()){
            Object obj = it.next();
        }
        Object obj = myList.get(1);
        System.out.println(obj);

        for (int i = 0; i < myList.size(); i++) {
            Object obj2 = myList.get(i);
            System.out.println(obj2);
        }
        System.out.println(myList.indexOf("b"));
        System.out.println(myList.lastIndexOf("V"));
        myList.remove(5);
        System.out.println(myList.size());
        myList.set(0,"Star platinum!!! 欧拉！");
        for (int i = 0; i < myList.size(); i++) {
            Object obj2 = myList.get(i);
            System.out.println(obj2);
        }
    }
}
